{include file="header.html"}

<script src="templates/jsnew/MediaStreamRecorder.js"> </script>
<script src="http://api.map.baidu.com/api?v=2.0&ak=kkA94xvGPjnprY92WU4yYME8"></script>

<script type="text/javascript">


$(function(){
	$("[id^='h_type_']").live("change",function(){
		var type = $(this).val();
		if(type==1){
			$(this).parent().parent().find('.range').hide();
		}else{
			$(this).parent().parent().find('.range').show();
		}
	});
    $('#acategory_form').validate({
        errorPlacement: function(error, element){
            //$(element).next('.noerror').hide();          
            //$(element).after(error);
        },
        success       : function(element){
        	 //$(element).next('.noerror').show();  
        	 //$(element).remove();
        	
        },
        rules : {
        	g_packingtime : {
                required : true
            },
            g_collectiontime : {
                required : true
            },
        	hzshow_ : {
                required : true
            },
            g_ship : {
                required : true
            },
            g_voyage : {
                required : true
            },
            g_awb_code : {
                required : true
            },
        	g_container_depot : {
                required : true
            },
			g_container_man : {
				required : true
			},
			g_container_tel : {
				required : true
			},
            g_full_container_depot :{
                required : true
            },
			g_full_container_man :{
				required : true
			},
			g_full_container_tel :{
				required : true
			},
            g_loading_place :{
            	required : true
            },
            g_loading_man :{
                required : true
            },
            g_loading_tel :{
                required : true
            }
        },
        messages : {
        	g_packingtime : {
                required : '装货时间必填'
            },
            g_collectiontime : {
                required : '到港时间必填'
            },
        	hzshow_ : {
                required : '货主必填'
            },
            g_ship : {
                required : '船名必填'
            },
            g_voyage : {
                required : '航次必填'
            },
            g_awb_code : {
                required : '提单号必填'
            },
        	g_container_depot : {
                required : '空箱场站必填'
            },
			g_container_man : {
				required : '空箱场站联系人必填'
			},
			g_container_tel : {
				required : '空箱场站电话必填'
			},
            g_full_container_depot : {
                required : '重箱场站必填'
            },
			g_full_container_man : {
				required : '重箱场站联系人必填'
			},
			g_full_container_tel : {
				required : '重箱场站电话必填'
			},
            g_loading_place : {
                required : '装货地必填'
            },
            g_loading_man : {
                required : '装货联系人必填'
            },
            g_loading_tel : {
                required : '装货联系电话必填'
            }
        }
    });
    
    $('#paiche_form').validate({
        errorPlacement: function(error, element){
            //$(element).next('.noerror').hide();          
            //$(element).after(error);
        },
        success       : function(element){
        	 $(element).next('.noerror').show();  
        	 $(element).remove();
        	
        },
        rules : {    
        	operator : {
                required : true
            },
            wm_vhc_code :{
                required : true
            },
            wm_driver :{
            	required : true
            },
            wm_driver_tel :{
                required : true
            }
        },
        messages : {
        	operator : {
                required : '承运商必填'
            },
            wm_vhc_code : {
                required : '车牌号必填'
            },
            wm_driver : {
                required : '司机必填'
            },
            wm_driver_tel : {
                required : '司机电话必填'
            }
        }
    });
    $("[id^='hzshowa_']").live('click',function(){
		var id=$(this).attr("item");
		$w=$(window).width();
        $h=$(window).height();
        $w=$w*0.7;
        $("#hzframe").attr("src","index.php?app=datarefer&act=choosehz"+"&hzid="+id);
    	$("#hzframe").width($w);
        $.colorbox({
            width : $w+20,
            height : "650px",
            inline : true,
            href : "#hzlist"
        });
	});
    
	 $("#g_packingtimeimg").click(function(){

		 $('#g_packingtime').focus();
	 });
    
	 $("#g_collectiontimeimg").click(function(){

		 $('#g_collectiontime').focus();
	 });
	 
	 $("#g_tgdateimg").click(function(){

		 $('#g_tgdate').focus();
	 });
    
    {if $cannew}
    $('#g_packingtime').datetimepicker({changeMonth: true,changeYear: true});
    $('#g_collectiontime').datetimepicker({changeMonth: true,changeYear: true});
    $('#g_tgdate').datetimepicker({changeMonth: true,changeYear: true});

    {/if}
    
    	
    $("#yinru").click(function(){
    	  $w=$(window).width();
          $h=$(window).height();
          $w=$w*0.7;
          $("#tagframe").attr("src","index.php?app=waybill&act=choosegoods&t="+$("#wm_type").val()+"&code="+$("#wm_code").val()+"&wmid="+$("#wm_tid").val());
      	  $("#tagframe").width($w);
          $.colorbox({
              width : $w+20,
              height : "650px",
              inline : true,
              href : "#taglist"
          });
    });
    
    $("#wm_vhc_code").click(function(){
    	  $w=$(window).width();
          $h=$(window).height();
          $w=$w*0.7;
          $("#pcframe").attr("src","index.php?app=datarefer&act=choose&wid="+$("#wm_tid").val()+"&oper="+$("#operator").val());
      	$("#pcframe").width($w);
          $.colorbox({
              width : $w+20,
              height : "650px",
              inline : true,
              href : "#pclist"
          });
  	});
    
    
    
    $("#cimg").click(function(){
  	  $w=$(window).width();
        $h=$(window).height();
        $w=$w*0.7;
        $("#pcframe").attr("src","index.php?app=datarefer&act=choose&wid="+$("#wm_tid").val()+"&oper="+$("#operator").val());
    	$("#pcframe").width($w);
        $.colorbox({
            width : $w+20,
            height : "650px",
            inline : true,
            href : "#pclist"
        });
	});
    
    
    
    
    
    $("#operatorshowa").click(function(){
  	  $w=$(window).width();
        $h=$(window).height();
        $w=$w*0.7;
        $("#opframe").attr("src","index.php?app=datarefer&act=chooseop&wid="+$("#wm_tid").val());
    	$("#opframe").width($w);
        $.colorbox({
            width : $w+20,
            height : "650px",
            inline : true,
            href : "#oplist"
        });
	});
    
    $("#trans").click(function(){
    	  $w=$(window).width();
          $h=$(window).height();
          $w=$w*0.7;
          $("#transframe").attr("src","index.php?app=waybill&act=trans&wid="+$("#wm_tid").val());
      	$("#transframe").width($w);
          $.colorbox({
              width : $w+20,
              height : "650px",
              inline : true,
              href : "#translist"
          });
  	});
    
});

function huozhu(textid,g_loading_man,g_loading_tel,valueid){
	var v=$("#"+textid).val();
	var urlval=$("#"+textid).attr("urlval");
	if(v!=""&&v!=null){
		$.ajax({
			type: "GET",
			url: urlval,
			data: {q:v},
			dataType: "json",
			success: function(data){
				if(!data.done){
					$("#"+valueid).val(0);
					$("#"+textid).val("");
					$("#"+g_loading_man).val("");
					$("#"+g_loading_tel).val("");
				}else{
					$("#"+valueid).val(data.retval.id);
					$("#"+textid).val(data.retval.text);
					$("#"+g_loading_man).val(data.retval.o_linkman);
					$("#"+g_loading_tel).val(data.retval.o_linktel);
				}
			}
		});
	}else{
		$("#"+valueid).val(0);
		$("#"+textid).val("");
		$("#"+g_loading_man).val("");
		$("#"+g_loading_tel).val("");
	}
}

function gethz(textid,g_loading_man,g_loading_tel,valueid){
	var url=$("#"+textid).attr("urldata");
	var urlval=$("#"+textid).attr("urlval");
	if(url==undefined||url==null||url==""||urlval==undefined||urlval==null||urlval==""){
		return;
	}
	AutoComplete({
		EmptyMessage: "没有数据",
		Url: url,
		_Select: function(item) {
			$("#"+textid).unbind("blur");
			$("#"+textid).val($(item).text());
			var attr = $(item).attr("data-autocomplete-value");
			var arr = attr.split(';');
			$("#"+valueid).val(arr[0]);
			$("#"+g_loading_man).val(arr[1]);
			$("#"+g_loading_tel).val(arr[2]);
			if(valueid!=undefined&&valueid!=""&&valueid!=null){
				$("#"+valueid).val(arr[0]);
			}
			//blur是验证
			$("#"+textid).blur(function(){
				huozhu(textid,g_loading_man,g_loading_tel,valueid);
			});
		}
	}, "#"+textid);
}

var mediaRecorder={};
function onMediaSuccess(stream) {
    mediaRecorder = new MediaStreamRecorder(stream);
    mediaRecorder.mimeType = 'audio/ogg';
    mediaRecorder.audioChannels = 1;
    mediaRecorder.ondataavailable = function (blob) {
        
    	var fileType = 'video'; // or "audio"
		var fileName = 'wm_requiredl_note_voice.ogg';  // or "wav" or "ogg"

		var formData = new FormData();
		formData.append(fileType + '-filename', fileName);
		formData.append(fileType + '-blob', blob);

		xhr('index.php?app=upload', formData, function (fileURL) {
		    window.open(fileURL);
		});

		function xhr(url, data, callback) {
		    var request = new XMLHttpRequest();
		    request.onreadystatechange = function () {
		        if (request.readyState == 4 && request.status == 200) {
		            //callback(location.href + request.responseText);
		            $("#wm_requiredl_note_voice").val(request.responseText);
		        }
		    };
		    request.open('POST', url);
		    request.send(data);
		}
    };
    mediaRecorder.start(10*60*1000);
}
function changeop(id,name){
	$('opframe').colorbox.close();
	$("#operator").val(id);
	$("#operatorshow").val(name);
}
function changehz(id,name,hzid,linkman,linktel){
	$.colorbox.close();
	if(hzid==''){
		$("[id='g_companytid_']").val(id);
		//$("#g_companytid_"+hzid).val(id);
		$("#hzshow_").val(name);
	}else{
		$("[id='g_companytid_"+hzid+"']").val(id);
		//$("#g_companytid_"+hzid).val(id);
		$("#hzshow_"+hzid).val(name);
	}
	$("#g_loading_man").val(linkman);
	$("#g_loading_tel").val(linktel);
}
function onMediaError(e) {
    console.error('media error', e);
}


function timeimg (type,number,id){
	
	if(type==1){
		if(number==1){
			$('#m_required_service_date'+id).focus();
		}else if(number==2){
			$('#m_required_leave_date'+id).focus();
		}
	}else if (type==3){
		$('#h_required_service_date_'+id).focus();
	}else if (type==4) {
		$('#e_handle_date_'+id).focus();
	}
}




function start(){
	$("#stopbtn").show();
	$("#startbtn").hide();
	var mediaConstraints = {audio: true};
	navigator.getUserMedia(mediaConstraints, onMediaSuccess, onMediaError);
}

function stop(){
	if(typeof mediaRecorder.stop=='function'){
		mediaRecorder.stop();
		$("#stopbtn").hide();
		$("#startbtn").show();
	}
}
function conform() {
	$("#wm_type").val($("#wmtype").val());
	$("#typediv").hide();
	$("[id='typeshow']").html("[" + $("#wmtype").val() + "]");

	if ($("#wm_type").val() == '集卡进口') {
		$("#th_g_packingtime").html('<b style="color: #ff0000">*&nbsp;</b>卸货时间:');
	}
	else {
		$("#th_g_packingtime").html('<b style="color: #ff0000">*&nbsp;</b>装货时间:');
	}
	if ($("#wm_type").val() == '集卡进口') {
		$("#th_g_collectiontime").html('<b style="color: #ff0000">*&nbsp;</b>到港时间:');
	}
	else if ($("#wm_type").val() == '集卡出口') {
		$("#th_g_collectiontime").html('<b style="color: #ff0000">*&nbsp;</b>集港时间:');
	}
	else {
		$("#th_g_collectiontime").html('<b style="color: #ff0000">*&nbsp;</b>卸货时间:');
	}

	if ($("#wm_type").val() == '集卡进口') {
		$("#th_g_loading_place").html('<b style="color: #ff0000">*&nbsp;</b>卸货地:');
	}
	else {
		$("#th_g_loading_place").html('<b style="color: #ff0000">*&nbsp;</b>装货地:');
	}
}

var l=10000;

var mainid=0;
var mapsender=null;
var newmapid;
	//地图选择
	function mapselect(mapid,id,sender){
		newmapid=mapid;
		mainid=id;
		mapsender=sender;
		
		
		
		$w=$(window).width();
		$h=$(window).height();
		$w=$w*0.7;
		$("#mapframe").attr("src","index.php?app=datarefer&act=mapselect&lng="+parseFloat($("[id='lng_"+mainid+"']").val())+"&lat="+parseFloat($("[id='lat_"+mainid+"']").val())+"&ret=window.parent.mapresult&address="+$(mapid).val());
		$("#mapframe").width($w);
		$.colorbox({
			width : $w+20,
			height : "650px",
			inline : true,
			href : "#maplist"
		});
	}
	
	function mapresult(lng,lat,addr){
		$('mapframe').colorbox.close();
		$("[id='lat_"+mainid+"']").val(lat);
		$("[id='lng_"+mainid+"']").val(lng);
		if(mapsender!=null){
			$(mapsender).html()
		}
		
		if(mainid=="container"){
			$("#g_container_depot").val(addr);
		}
		if(mainid=="full_container"){
			$("#g_full_container_depot").val(addr);
		}
		if(mainid=="loading"){
			$("#g_loading_place").val(addr);
		}
		if(newmapid=="#haul_"+mainid+"_h_address"){
			
			$("#haul_"+mainid+"_h_address").val(addr);
		}

		if(lat>0&&lng>0){
			$("#mapimg_"+mainid).attr("src","templates/images/newadmin/map1.png");
		}
		
	}

</script>




<style>
.infoTable{
margin: 0 0 0 0;
}
.info th {
    text-align: right;
    
}
#form11 th,#form1 th{
text-align: right;
    padding-right: 15px;
}
.infoTableInput,.infoTable select{
	width: 100%;
}
.grayb{background: #eee;}
.info td a{color: #1874CD}
.itemdiv .querySelect{height: 23px;
   width:200px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;}
    .itemdiv .infoTableInput{height: 23px;
   width:300px;
    padding: 0 5px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;}
.haul_div{
	border-left: 4px solid #76b5ea;
	border-top: 1px solid #d3dae0;
	border-bottom: 1px solid #d3dae0;
	border-right: 1px solid #d3dae0;
	margin: 10px 10px 0 20px;
}
a.btn_add,.rmlink{
	display: inline-block !important;
	height: 23px;
	margin: 5px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	outline: 0;
	background-image: none;
	background-color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 23px;
	color: #1a1a1a;
	text-align: center;
	vertical-align: top;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-o-box-sizing: border-box;
	background-color: #0ae;
	border-color: #0ae;
	color: #fff;
	text-shadow: none;
}
</style>


<div id="rightTop">
	<p>{$lang.waybill_trunk} <lable id="typeshow" style="font-weight: bold;">[{$waybill.wm_type}]</lable> {$waybill.wm_code} [{$waybill.wm_stauts}]</p>
	<ul class="subnav">
		<li><a class="btn1" href="index.php?app=waybill">{$lang.manage}</a>
		</li>
		<!-- {if $waybill.wm_tid}} -->
		<li>
			<a class="btn1" href="index.php?app=waybill&amp;act=add">{$lang.add}</a>
		</li>
		<li>
			<span>编辑</span></li>
		<!-- {else} -->
		<li>
			<span>新建</span>
		</li><!-- {/if} -->
	</ul>
</div>
{if !$waybill.wm_type}
<div id="typediv">
<div class="mask" style="display: block;">
<div style="width: 260px;
    background: #fff;
    height: 150px;
    padding: 20px;    margin: 0 auto;
    margin-top: 100px;">
<div style="    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding: 0 0 10px 0;
    margin-bottom: 10px;">请选择运单类型</div>
	<select  class="querySelect" name="wmtype" id="wmtype" style="height: 32px;
    width: 100%;
    padding: 6px 10px 8px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;margin-bottom: 5px">{html_options options=$type_options selected=$waybill.wm_type}</select>
	<p style="text-align: center;margin-top: 18px;"><input class="formbtn" type="submit" name="Submit" onclick="conform()" value="确定"/></p>
</div>
</div>
</div>
{/if}
<div style="display: none"  >
	<div id="pclist">
	<iframe id="pcframe" src="index.php?app=datarefer&act=choose&wid={$waybill.wm_tid}" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="taglist">
	<iframe id="tagframe" src="index.php?app=waybill&act=choosegoods" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="oplist">
	<iframe id="opframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="hzlist">
	<iframe id="hzframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="maplist">
		<iframe id="mapframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="translist">
		<iframe id="transframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div style="display: none"  >
	<div id="monitorlist">
		<iframe id="monitorframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
	</div>
</div>
<div class="info">

	{if $canyy&&$canedit}<div class="infoTable" style="padding-left: 10px;padding-top: 20px">
<input class="formbtn" type="button" id="yinru" value="引入货物">
	{if $waybill.wm_stauts=='新建'&&$waybill.wm_tid}<input class="formbtn" type="button" id="trans" value="转运货物">{/if}
	</div>
{/if}

<script>
function addrow(){
	var t=$("#templete").html();
	l++;
	t=t.replace(/{line}/g,l);
	$("#huo").append(t);
}
var f=100000;
var i=1000000;
function addhaul(){
	var t=$("#templete_haul").html();
	f++;
	i++;
	t=t.replace(/{num}/g,f).replace(/{fig}/g,i);
	$("#div_haul").append(t);
	//给模版绑定事件
	$(".addhandle2:last").on("click",addhandle);
}
function addhandle(){
	var th=$("#templete_handle").html();
	i++;
	var oldValue=parseInt($(this).attr('dig'));//取出现在的值，并使用parseInt转为int类型数据
	oldValue++;//自加1
	$(this).attr('dig',oldValue);
	var haul_num = $(this).attr('var');
	th=th.replace(/{num}/g,haul_num).replace(/{fig}/g,i).replace(/{c}/g,oldValue);
	$(this).parents(".itemdiv").append(th);

}
function formsub(){
	var f=true;
	$("[id^='g_volume_']").each(function(){
		if($(this).val()==""&&$(this).attr("item")>=0){
			f=false;
			$(this).addClass("error");
		}
	});
// 	$("[id^='g_ctn_no_']").each(function(){
// 		if($(this).val()==""&&$(this).attr("item")>=0){
// 			f=false;
// 			$(this).addClass("error");
// 		}
// 	});
	if(!f){
		return false;
	}
	
	$("#acategory_form").submit();
}
$(function(){
	$(".addhandle2").on("click",addhandle);
	$("[id^='g_volume_']").live('focus',function(){
		$(this).removeClass("error");
	});
	$("[id^='g_ctn_no_']").live('focus',function(){
		$(this).removeClass("error");
	});
	
	$("[id^='del_']").live('click',function(){
		var i=$(this).attr("item");
		var t=$(this);
		if(confirm("是否要删除此行?")){
			if(i>0){
				 $.ajax({
		             type: "post",
		             url: "index.php?app=waybill&act=delsub",
		             data: {id:i},
		             dataType: "json",
		             success: function(data){
		                        if(data.done){
		                        	t.parent().parent().remove();

		                    		if($("#huo").find("tr").length==0){
		                    			addrow();
		                    		}
		                        }else{
		                        	alert(data.msg);
		                        }
		                      }
		         });
			}else{
				$(this).parent().parent().remove();

				if($("#huo").find("tr").length==0){
					addrow();
				}
			}
		}
	});

	//选择监控方案
	$("#wm_zmmtid").change(function(){
		//ajax处理
		var id = $("#wm_tid").val();
		var mid = $(this).val();
		if(mid==''){
			alert('请选择监控方案');
			return false;
		}
		$.ajax({
			type: "post",
			url: "index.php?app=waybill&act=monitor",
			data: {id:id,mid:mid},
			dataType: "json",
			success: function(data){
				if(data.done){
					//成功的提示
					$("#syss").text(data.msg);
					$("#syss").slideDown();
					setTimeout(function(){
						$("#syss").slideUp();
					},2000);
				}else{
					alert(data.msg);
				}
			}
		});
		//window.location.href="index.php?app=waybill&act=monitor&id="++"&mid="+;
	});
	
	$("#yuncheng").change(function(){
		if(confirm("确认删除现运程,引入新方案吗?")){
			window.location.href="index.php?app=waybill&act=hauldefine&id="+$("#wm_tid").val()+"&hid="+$(this).val();
		}
	});
});
//监控方案详情
function monitorinfo(mid){
	var wm_zmmtid = $("#wm_zmmtid").val();
	if(wm_zmmtid=='' || wm_zmmtid==0){
		alert('请先选择监控方案，再查看详情');
		return false;
	}
	$w=$(window).width();
	$h=$(window).height();
	$w=$w*0.7;
	$("#monitorframe").attr("src","index.php?app=datarefer&act=monitorinfo&mid="+wm_zmmtid);
	$("#monitorframe").width($w);
	$.colorbox({
		width : $w+20,
		height : "650px",
		inline : true,
		href : "#monitorlist"
	});
}
</script>
<div class="mask" id="mask">
	<div><img src="templates/images/loading.gif"></div>
</div>
 <table style="display: none" id="templete">
	<tr>
		<th  class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>箱型:
		</th>
		<td style="width: 200px;">
		<select  class="querySelect" name="g_box[{line}]" id="g_box_{line}" item="{line}">{html_options options=$box_options}</select>

		</td>

		<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>箱量:  </th>
		<td style="width: 200px;">  <input type="text" placeholder="箱量必填" name="g_volume[{line}]" item="{line}" id="g_volume_{line}" class="infoTableInput">

		</td>

		<th class="paddingT15">箱号:  </th>
		<td style="width: 200px;">  <input type="text"  name="g_ctn_no[{line}]" item="{line}" id="g_ctn_no_{line}" class="infoTableInput">

		</td>

		<th class="paddingT15">设备号:  </th>
		<td style="width: 200px;">
		<a id="del_{line} item="0" href="javasciprt:;">删除</a>
		</td>
 </tr>
 </table>
<div id="templete_haul" style="display: none">
	<div class = "haul_div">
		<table class="infoTable tt" style="width:98%;padding: 10px 0 0 0">
			<tr>
				<th class="paddingT15">运程:</th>
				<td class="paddingT15 wordSpacing5">
					<input class="infoTableInput" type="text" name="haul[{num}][h_name]" value="" />
					<input type="hidden" name="haul[{num}][h_tid]" value="" />
				</td>
				<th class="paddingT15">联系人: </th>
				<td class="paddingT15 wordSpacing5">
					<input 	class="infoTableInput" type="text" name="haul[{num}][h_linkman]" value=""  />
				</td>
				<th class="paddingT15">电话:</th>
				<td class="paddingT15 wordSpacing5">
					<input 	class="infoTableInput" type="text" name="haul[{num}][h_linkman_tel]" value="" />
				</td>
				<th class="paddingT15">确认类型:</th>
				<td class="paddingT15 wordSpacing5">
					<select class="querySelect" name="haul[{num}][h_type]" id="h_type_{num}">
						{html_options options=$typelist selected=$h.h_type}
					</select>
				</td>
				<th class="paddingT15 range">运程范围:</th>
				<td class="paddingT15 wordSpacing5 range">
					<input class="infoTableInput" placeholder="请填写数字" type="text" name="haul[{num}][h_range]" value="" />
				</td>
			</tr>
			<tr>
				<th class="paddingT15">状态:</th>
				<td class="paddingT15 wordSpacing5" style="font-size: 14px">
					未开始
				</td>
				<th class="paddingT15">时间:</th>
				<td class="paddingT15 wordSpacing5" >
					<input 	class="infoTableInput" type="text" name="haul[{num}][h_required_service_date]"
							  value="-" id="h_required_service_date_{num}" />
					<script>
						$("#h_required_service_date_{num}").datetimepicker({changeMonth: true,changeYear: true});
					</script>
					<a href="javascript:void(0);" onclick="timeimg('3','1',{num});"  class="right_a">
						<img src="templates/images/newadmin/rili.png" alt="">
					</a>
				</td>
				<th class="paddingT15">要求:</th>
				<td class="paddingT15 wordSpacing5" >
					<input 	class="infoTableInput" type="text" name="haul[{num}][h_note]" value=""  />
				</td>
				<th class="paddingT15">地址:</th>
				<td class="paddingT15 wordSpacing5">
					<input type="hidden" value="" name="haul[{num}][h_lat]" id="lat_{num}">
					<input type="hidden" value="" name="haul[{num}][h_lng]" id="lng_{num}">
					<input class="infoTableInput" type="text" name="haul[{num}][h_address]" value="" id="haul_{num}_h_address"  />
					<a href="javascript:void(0);" onclick="mapselect('haul_{num}_h_address',{num},this);" class="right_a">
						<img src="templates/images/newadmin/map.png" alt="" id="mapimg_{num}">
					</a>
				</td>
			</tr>
		</table>
		<div style="padding: 0 0 0 50px" class="itemdiv">
			<a class="addhandle2 btn_add" var="{num}" dig=1 >采集信息</a>
			<div style="padding: 2px 0;">
				<input type="hidden" name="haul[{num}][item][{fig}][hc_tid]" value="" />
				<span style="background: #ccccce;display: block;padding: 5px 8px;float: left">1</span>
				<p style="float: left;margin: 0 40px">操作：
					<select class="querySelect" name="haul[{num}][item][{fig}][h_collect_type]" >
						{html_options options=$ctype}
					</select>
				</p>
				<p style="float: left;margin: 0 40px">说明：<input class="infoTableInput" type="text" name="haul[{num}][item][{fig}][h_collect_des]" value="" style="float: none"/></p>
				<div style="clear: both"></div>
			</div>
		</div>
	</div>
</div>
<div id="templete_handle" style="display: none">
	<div style="padding: 2px 0;">
		<input type="hidden" name="haul[{num}][item][{fig}][hc_tid]" value="" />
		<span style="background: #ccccce;display: block;padding: 5px 8px;float: left">{c}</span>
		<p style="float: left;margin: 0 40px">操作：
			<select class="querySelect" name="haul[{num}][item][{fig}][h_collect_type]" >
				{html_options options=$ctype}
			</select>
		</p>
		<p style="float: left;margin: 0 40px">说明：<input class="infoTableInput" type="text" name="haul[{num}][item][{fig}][h_collect_des]" value="" style="float: none"/></p>
		<div style="clear: both"></div>
	</div>
</div>
   {foreach from=$sub item=s}
	<form method="post" enctype="multipart/form-data" id="acategory_form">
	<input type="hidden" value="{$waybill.wm_type}" name="wm_type" id="wm_type">
	<input type="hidden" name="wm_code" value="{$waybill.wm_code}" id="wm_code">
	<input type="hidden" name="g_tid" value="{$s.g_tid}"/>
	<div class="jui-cut-label fn-mt25">
	        <div class="jui-message-bar">货物信息{if $cannew&&$canedit}<a style="float: right;margin-right: 20px" onclick="addrow();">添加货物</a>{/if}</div>
	    </div>
	    <table class="infoTable" style="padding-bottom: 0px" id="huo">
	    	{if $s.box}
		 {foreach from=$s.box item=b}
			<tr>
				<th  class="paddingT15"><p class="left_th"><b style="color: #ff0000">*&nbsp;</b>箱型: </p>
				</th>
				<td style="width: 200px;">
				<select class="querySelect" {if $canyy&&$b.gs_tid>0}disabled="disabled"{/if} name="g_box[{$b.gs_tid}]" id="g_box_{$b.gs_tid}" item="{$b.gs_tid}">{html_options options=$box_options selected=$b.g_box}</select>	
				<input type="hidden" name="gs_tid[{$b.gs_tid}]" value="{$b.gs_tid}" >			
				</td>
				
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>箱量:  </th>
             	<td style="width: 200px;">
             	<input type="text" placeholder="箱量必填" name="g_volume[{$b.gs_tid}]" id="g_volume_{$b.gs_tid}" item="{$b.gs_tid}" 
             	class="infoTableInput {if $canyy&&$b.gs_tid>0}grayb" readonly="readonly"{else}"{/if} value="{$b.ws_volume}">           	
             	</td>
             	
             	<th class="paddingT15">箱号:  </th>
             	<td style="width: 200px;">  <input type="text" name="g_ctn_no[{$b.gs_tid}]" id="g_ctn_no_{$b.gs_tid}" item="{$b.gs_tid}"
             	class="infoTableInput {if $canyy&&$b.gs_tid>0}grayb" readonly="readonly"{else}"{/if} value="{$b.g_ctn_no}">           	
             	</td>
             	
             	<th class="paddingT15">设备号:  </th>
             	<td style="width: 200px;">{$b.g_eir_code}&nbsp;&nbsp;&nbsp;&nbsp;{if $canyy&&$b.gs_tid>0}{else} {if $canedit}<a id="del_{$b.ws_tid}" item="{$b.ws_tid}" href="javasciprt:;">删除</a>{/if} {/if}
             	</td>
         </tr>
         {/foreach}
         {else}
         <tr>
				<th  class="paddingT15"><p class="left_th"><b style="color: #ff0000">*&nbsp;</b>箱型: </p>
				</th>
				<td style="width: 200px;">
				<select  class="querySelect" name="g_box[0]" id="g_box_0" item="0">{html_options options=$box_options}</select>
				
				</td>
				
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>箱量:  </th>
             	<td style="width: 200px;">  <input placeholder="箱量必填" type="text" name="g_volume[0]" id="g_volume_0" item="0" class="infoTableInput">
             	
             	</td>
             	
             	<th class="paddingT15">箱号:  </th>
             	<td style="width: 200px;">  <input type="text" name="g_ctn_no[0]" id="g_ctn_no_0" item="0" class="infoTableInput">
             	
             	</td>
             	
             	<th class="paddingT15">设备号:  </th>
             	<td style="width: 200px;">  
             	
             	</td>
         </tr>
         {/if}
         </table>
         <hr style="FILTER: alpha(opacity=100,finishopacity=0,style=1)" size="1" width="83%" color="#ccc">
		<table class="infoTable">
			<tr>
				<th  class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>货主: 
				
				</th>
				<td>
				<input type="hidden" value="{$s.g_companytid}" name="g_companytid" id="g_companytid_{$s.g_tid}">
				<input type="text"  placeholder="货主必填" value="{$hhh[$s.g_companytid]}" 
				item="{$s.g_tid}" name="hzshow_{$s.g_tid}" id="hzshow_{$s.g_tid}" 
				class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}
				urldata="index.php?app=datarefer&act=gethz" urlval="index.php?app=datarefer&act=gethzinfo"
				>
					<a href="javascript:void(0);" class="right_a" item="{$s.g_tid}" id="hzshowa_{$s.g_tid}" ><img src="templates/images/newadmin/serch.png" alt=""></a>
				
				<script>
					gethz("hzshow_{$s.g_tid}","g_loading_man","g_loading_tel","g_companytid_{$s.g_tid}");
				</script>
				</td>
				
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>船名:  </th>
             	<td >  <input type="text" placeholder="船名必填" value="{$s.g_ship}" name="g_ship" id="g_ship" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}>
             	
             	</td>
             	
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>航次:  </th>
             	<td >  <input type="text" placeholder="航次必填" value="{$s.g_voyage}" name="g_voyage" id="g_voyage" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}>
             	
             	</td>

         </tr>


			<tr>
				<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>提单号:  </th>
				<td >  <input type="text" placeholder="提单号必填" value="{$s.g_awb_code}" name="g_awb_code" id="g_awb_code" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}>

				</td>
			<th class="paddingT15" id="th_g_packingtime"><b style="color: #ff0000">*&nbsp;</b>{if $waybill.wm_type=='集卡出口'}装货时间{elseif $waybill.wm_type=='集卡进口' }
	卸货时间{else}装货时间{/if}:</th>
								<td class="paddingT15 wordSpacing5">
									<input placeholder="必填" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} type="text"
							 name="g_packingtime" id="g_packingtime" value="{if $s.g_packingtime}{$s.g_packingtime|date:Y-m-d H:i}{else}{/if}" />
									<a href="javascript:void(0);"  class="right_a"><img id="g_packingtimeimg" src="templates/images/newadmin/rili.png" alt=""></a>
								</td>
		<th class="paddingT15" id="th_g_collectiontime"><b style="color: #ff0000">*&nbsp;</b>{if $waybill.wm_type=='集卡出口'}集港时间{elseif $waybill.wm_type=='集卡进口' }
			到港时间{else}卸货时间{/if}:
						</th>
					
								<td class="paddingT15 wordSpacing5" ><input placeholder="必填"
							class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} type="text"
							 name="g_collectiontime" id="g_collectiontime"
							value="{if $s.g_collectiontime}{$s.g_collectiontime|date:Y-m-d H:i}{/if}" />
									<a href="javascript:void(0);"  class="right_a"><img id="g_collectiontimeimg" src="templates/images/newadmin/rili.png" alt=""></a>
							</td>
		</tr>
		
		<tr>
				<th  class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>空箱场站: 
				
				</th>
				<td>
					<input type="hidden" value="{$s.g_container_lng}" name="g_container_lng" id="lng_container"><!--经度-->
					<input type="hidden" value="{$s.g_container_lat}" name="g_container_lat" id="lat_container">
					<input type="text" name="g_container_depot" placeholder="空箱场站必填" value="{$s.g_container_depot}" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_container_depot" urldata="index.php?app=datarefer&act=getaddr" urlval="index.php?app=datarefer&act=getaddrinfo" >
					{if $canyy}
					{else}
					<a href="javascript:void(0);" onclick="mapselect('#g_container_depot','container',this)" class="right_a">
						{if $s.g_container_lng>0&&$s.g_container_lat>0}
						<img src="templates/images/newadmin/map1.png" alt="" id="mapimg_container">
						{else}
						<img src="templates/images/newadmin/map.png" alt="" id="mapimg_container">{/if}
					</a>
					{/if}
					<script>
						addrrefer("g_container_depot","lng_container","lat_container","mapimg_container");
					</script>
				</td>
				<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>空箱场站联系人:</th>
				<td class="paddingT15 wordSpacing5">
					<input type="text" name="g_container_man" placeholder="空箱场站联系人必填" value="{$s.g_container_man}" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_container_man" >
				</td>
				<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>空箱场站电话:</th>
				<td class="paddingT15 wordSpacing5">
					<input type="text" name="g_container_tel" placeholder="空箱场站电话必填" value="{$s.g_container_tel}" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_container_tel" >
				</td>
				

             	
         </tr>
		<tr>
			<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>重箱场站:  </th>
			<td>
				<input type="hidden" value="{$s.g_full_container_lng}" name="g_full_container_lng" id="lng_full_container"><!--经度-->
				<input type="hidden" value="{$s.g_full_container_lat}" name="g_full_container_lat" id="lat_full_container">
				<input type="text" placeholder="重箱场站必填" name="g_full_container_depot" value="{$s.g_full_container_depot}" class="infoTableInput{if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_full_container_depot" urldata="index.php?app=datarefer&act=getaddr" urlval="index.php?app=datarefer&act=getaddrinfo">
				{if $canyy}
				{else}
				<a href="javascript:void(0);" onclick="mapselect('#g_full_container_depot','full_container',this)" class="right_a">
					{if $s.g_full_container_lng>0&&$s.g_full_container_lat>0}
					<img src="templates/images/newadmin/map1.png" alt="" id="mapimg_full_container">
					{else}
					<img src="templates/images/newadmin/map.png" alt="" id="mapimg_full_container">{/if}
				</a>
				{/if}
				<script>
					addrrefer("g_full_container_depot","lng_full_container","lat_full_container","mapimg_full_container");
				</script>
			</td>
			<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>重箱场站联系人:</th>
			<td class="paddingT15 wordSpacing5">
				<input type="text" name="g_full_container_man" placeholder="重箱场站联系人必填" value="{$s.g_full_container_man}" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_full_container_man" >
			</td>
			<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>重箱场站电话:</th>
			<td class="paddingT15 wordSpacing5">
				<input type="text" name="g_full_container_tel" placeholder="重箱场站电话必填" value="{$s.g_full_container_tel}" class="infoTableInput{if $canyy}grayb" readonly="readonly"{else}"{/if} id="g_full_container_tel" >
			</td>
		</tr>
         <tr>
				<th  class="paddingT15" id="th_g_loading_place"><b style="color: #ff0000">*&nbsp;</b>{if $waybill.wm_type=='集卡出口'}装货地{elseif $waybill.wm_type=='集卡进口' }
					卸货地{else}卸货地{/if}:
				
				</th>
				<td>
					<input type="hidden" value="{$s.g_loading_lng}" name="g_loading_lng" id="lng_loading"><!--经度-->
					<input type="hidden" value="{$s.g_loading_lat}" name="g_loading_lat" id="lat_loading">
					<input type="text" value="{$s.g_loading_place}" placeholder="必填" name="g_loading_place" id="g_loading_place" urldata="index.php?app=datarefer&act=getaddr" urlval="index.php?app=datarefer&act=getaddrinfo" class="infoTableInput {if $canyy&&$b.gs_tid>0}grayb" readonly="readonly"{else}"{/if}>
					{if $canyy}
					{else}
					<a href="javascript:void(0);" onclick="mapselect('#g_loading_place','loading',this)" class="right_a">
						{if $s.g_loading_lat>0&&$s.g_loading_lng>0}
						<img src="templates/images/newadmin/map1.png" alt="" id="mapimg_loading">
						{else}
						<img src="templates/images/newadmin/map.png" alt="" id="mapimg_loading">{/if}
					</a>
					{/if}
					<script>
						addrrefer("g_loading_place","lng_loading","lat_loading","mapimg_loading");
					</script>
				</td>
				
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>联系人:  </th>
             	<td>  <input placeholder="联系人必填" type="text" value="{$s.g_loading_man}" name="g_loading_man" id="g_loading_man" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}>
             	
             	</td>
             	<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>电话:  </th>
             	<td >  <input placeholder="电话必填" type="text" value="{$s.g_loading_tel}" name="g_loading_tel" id="g_loading_tel" class="infoTableInput {if $canyy}grayb" readonly="readonly"{else}"{/if}>
             	
             	</td>
             	
         </tr>
		
<tr>
	<th class="paddingT15">{$lang.wm_note}:
	</th>
	<td class="paddingT15 wordSpacing5" colspan="8">
		
		<textarea name="g_note" id="g_note" rows="3" style="width: 100%"  class="{if $canyy}grayb" readonly="readonly"{else}"{/if}>{$s.g_note}</textarea>
		
		</td>
</tr>
		{if $canyy}
		{else}
			<tr>
				<th></th>
				<td class="ptb20" colspan="7" style="text-align: left">{if $canedit}<input class="formbtn" type="button" name="Submit" value="{$lang.submit}" onclick="formsub()"/>{/if}
				</td>
			</tr>
			{/if}
		</table>
	</form>
	{/foreach}
	<!-- {if $waybill.wm_tid}} -->
	<form method="post" enctype="multipart/form-data" id="paiche_form" action="index.php?app=waybill&act=pcsave">
		<input type="hidden" value="{$waybill.wm_tid}" name="wm_tid" id="wm_tid">
		<input type="hidden" value="{$waybill.wm_carrier_id}" name="operator" id="operator">
		<div class="jui-cut-label fn-mt25">
	        <div class="jui-message-bar">派车信息
			<a style="float: right;margin-right: 20px" onclick="monitorinfo()">查看监控方案</a>
	        <p style="float: right;margin-right: 10px;">监控方案：<select {if !$canedit}disabled="disabled"{/if} class="querySelect" name="wm_zmmtid" id="wm_zmmtid"><option value="">请选择监控方案</option>{html_options options=$monitor selected=$waybill.wm_zmmtid}</select></p></div>

		</div>
	    <table class="infoTable">
	    <tr>
				<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.wm_carrier}:</th>
				<td class="paddingT15 wordSpacing5">
				<input
					class="infoTableInput" id="operatorshow" type="text"
					name="operatorshow" value="{$oper[$waybill.wm_carrier_id]}" urldata="index.php?app=datarefer&act=getcys" urlval="index.php?app=datarefer&act=getcysinfo"/>
					<a href="javascript:void(0);" class="right_a" id="operatorshowa"><img src="templates/images/newadmin/serch.png" alt=""></a>
					<script>
				refer("operatorshow","operator");
				</script>
					</td>
					
					<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.wm_vhc_code}:
				</th>
				<td class="paddingT15 wordSpacing5" style="position: relative;"><input
					class="infoTableInput" id="wm_vhc_code" type="text"
					name="wm_vhc_code" value="{$waybill.wm_vhc_code}" />{if $canedit&&$waybill.wm_tid>0}<a href="javascript:void(0);" class="right_a"><img id='cimg' src="templates/images/newadmin/serch.png" alt=""></a>{/if}</td>
					
						<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.wm_driver}:
				</th>
				<td class="paddingT15 wordSpacing5"><input
					class="infoTableInput" id="wm_driver" type="text"
					name="wm_driver" value="{$waybill.wm_driver}" /></td>
			
			<th class="paddingT15"><b style="color: #ff0000">*&nbsp;</b>{$lang.wm_driver_tel}:
				</th>
				<td class="paddingT15 wordSpacing5"><input
					class="infoTableInput" id="wm_driver_tel" type="text"
					name="wm_driver_tel" value="{$waybill.wm_driver_tel}" /></td>
				
			</tr>


			<tr>
<th class="paddingT15">发车要求:
				</th>
				<td class="paddingT15 wordSpacing5" colspan="3" >
					<input type="hidden" id="wm_requiredl_note_voice" name="wm_requiredl_note_voice" value="{$waybill.wm_requiredl_note_voice}"/>
					 {if $waybill.wm_requiredl_note_voice}
<audio controls="controls">

<source src="{$waybill.wm_requiredl_note_voice}" type="audio/ogg">

你的浏览器太老了，请更新否则没法听语音
</audio>
{/if}
					<textarea  name="wm_requiredl_note" id="wm_requiredl_note" rows="3" style="width: 100%">{$waybill.wm_requiredl_note}</textarea>
					
					</td>
			</tr>
			
			{if 1==0}
			{if $canedit}
			<tr>
			<th class="paddingT15">录音:
				</th>
				<td class="paddingT15 wordSpacing5" colspan="3" style="text-align: left">
					<input type="hidden" id="wm_requiredl_note_voice" name="wm_requiredl_note_voice" value="{$waybill.wm_requiredl_note_voice}"/>
					 {if $waybill.wm_requiredl_note_voice}
<audio controls="controls">

<source src="{$waybill.wm_requiredl_note_voice}" type="audio/ogg">

你的浏览器太老了，请更新否则没法听语音
</audio>
{/if}
					{if $waybill.wm_stauts=='新建'||$waybill.wm_stauts=='已接单'}
<input type="button" onclick="start()" value="录音" id="startbtn"/>
<input type="button" onclick="stop()" value="停止"  id="stopbtn" style="display: none"/>
{/if}
					
					</td>
			
			</tr>
			{/if}
			{/if}
			<tr>
			
				<th class="paddingT15">{$lang.wm_dispatch_person}:
				</th>
				<td class="paddingT15 wordSpacing5"><input
					class="infoTableInput" id="wm_dispatch_person" type="text" readonly="readonly"
					name="wm_dispatch_person" value="{$waybill.wm_dispatch_person}" style="border: 0;" />
				</td>
				<th class="paddingT15">{$lang.wm_dispatch_person_tel}:
				</th>
				<td class="paddingT15 wordSpacing5"><input
					class="infoTableInput" id="wm_dispatch_person_tel" type="text" readonly="readonly"
					name="wm_dispatch_person_tel"
					value="{$waybill.wm_dispatch_person_tel}" style="border: 0;" /></td>
					
					<th class="paddingT15">{$lang.wm_dispatch_date}:
				</th>
				<td class="paddingT15 wordSpacing5"><input
					class="infoTableInput" id="wm_dispatch_date" type="text" readonly="readonly"
					name="wm_dispatch_date" value="{$waybill.wm_dispatch_date|date:Y-m-d H:i}" style="border: 0;" /> </td>
				
			</tr>
			{if $canedit}
			<tr>
				<th></th>
			<td class="ptb20" colspan="7" style="text-align: left"><input class="formbtn" type="submit"
					name="Submit" value="保存"/>
					<a class="formbtn" type="button" href="index.php?app=waybill&act=paichedone&wm_tid={$waybill.wm_tid}&wm_user={$waybill.wm_user}"
					name="Submit" >发车</a>
					</td>
					

			</tr>	{/if}

</table>
	</form>
	<!-- {if $waybill.wm_tid}} -->
		<form method="post" enctype="multipart/form-data" action="index.php?app=waybill&act=hauledit" >
			<input type="hidden" value="{$waybill.wm_tid}" name="wm_tid">
			<div class="jui-cut-label fn-mt25">
				<div class="jui-message-bar">运程信息
					<p style="float: right">{if $canedit}运程方案：<select {if !$canedit}disabled="disabled"{/if} class="querySelect" id="yuncheng">
					<option value="">请选择运程方案</option>{html_options options=$hauldefine}</select>{/if}</p>
					{if $canedit}
					<a style="float: right;margin-right: 20px" onclick="addhaul();">添加运程</a>
					{/if}
				</div>
			</div>
			  <style>
			  	.tt th{width: 70px}
			  </style>
			<div id="div_haul">
				{foreach from=$haullist item=h}
				<div class = "haul_div" >
					<table class="infoTable tt" style="width:98%;padding: 10px 0 0 0">
					<tr>
							<th class="paddingT15">运程:</th>
							<td class="paddingT15 wordSpacing5">
							<input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_name]" value="{$h.h_name}" />

								<input type="hidden" name="haul[{$h.h_tid}][h_tid]" value="{$h.h_tid}" />
								</td>

								<th class="paddingT15">联系人:
							</th>
							<td class="paddingT15 wordSpacing5"><input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_linkman]" value="{$h.h_linkman}"  /></td>

									<th class="paddingT15">电话:
							</th>
							<td class="paddingT15 wordSpacing5"><input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_linkman_tel]" value="{$h.h_linkman_tel}" /></td>

						<th class="paddingT15">确认类型:
							</th>
							<td class="paddingT15 wordSpacing5">
							<select class="querySelect" name="haul[{$h.h_tid}][h_type]" id="h_type_{$h.h_tid}">{html_options options=$typelist selected=$h.h_type}</select></td>
						<th class="paddingT15 range" style="display:{if $h.h_type==1}none{/if}">运程范围:</th>
						<td class="paddingT15 wordSpacing5 range" style="display:{if $h.h_type==1}none{/if}">
							<input class="infoTableInput" placeholder="请填写数字" type="text" name="haul[{$h.h_tid}][h_range]"  value="{$h.h_range}" />
						</td>
						</tr>


						<tr>
							<th class="paddingT15">状态:</th>
							<td class="paddingT15 wordSpacing5" style="font-size: 14px">
							{if $h.h_finished==0}未开始{/if}{if $h.h_finished==-1}异常{/if}{if $h.h_finished==2}完成{/if}
								{if $h.h_finished_date}{$h.h_finished_date|date:Y-m-d H:i}{/if}
								</td>
								<th class="paddingT15">时间:</th>
							<td class="paddingT15 wordSpacing5" >
							<input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_required_service_date]"
								value="{if $h.h_required_service_date}{$h.h_required_service_date|date:Y-m-d H:i}{else}-{/if}"
								id="h_required_service_date_{$h.h_tid}" />
								{if $canedit}
								 <script>
								$('#h_required_service_date_{$h.h_tid}').datetimepicker({changeMonth: true,changeYear: true});
								</script>
								{/if}<a href="javascript:void(0);" onclick="timeimg('3','1',{$h.h_tid});"  class="right_a"><img src="templates/images/newadmin/rili.png" alt=""></a>
								</td>



							<th class="paddingT15">要求:</th>
							<td class="paddingT15 wordSpacing5" >
							<input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_note]" value="{$h.h_note}"  />
								</td>
								<th class="paddingT15">地址:</th>
							<td class="paddingT15 wordSpacing5">
							<input type="hidden" value="{$h.h_lat}" name="haul[{$h.h_tid}][h_lat]" id="lat_{$h.h_tid}">
							<input type="hidden" value="{$h.h_lng}" name="haul[{$h.h_tid}][h_lng]" id="lng_{$h.h_tid}">
							<input
								class="infoTableInput" type="text"
								name="haul[{$h.h_tid}][h_address]" value="{$h.h_address}" id="haul_{$h.h_tid}_h_address"  />
								<a href="javascript:void(0);" onclick="mapselect('#haul_{$h.h_tid}_h_address',{$h.h_tid},this);" class="right_a">
								{if $h.h_lat>0&&$h.h_lng>0}<img src="templates/images/newadmin/map1.png" alt="" id="mapimg_{$h.h_tid}">{else}<img src="templates/images/newadmin/map.png" alt="" id="mapimg_{$h.h_tid}">{/if}</a>
								</td>
						</tr>
					</table>
				<div style="padding: 0 0 0 50px" class="itemdiv">
					{if $canedit && $h.h_finished==0}
					<a class="addhandle2 btn_add" var="{$h.h_tid}" dig="{$h.item|modifier:getcount}" >采集信息</a>
					{/if}
				{foreach from=$h.item item=i name=it}
				<div style="padding: 2px 0;">
				<input type="hidden" name="haul[{$h.h_tid}][item][{$i.hc_tid}][hc_tid]" value="{$i.hc_tid}" />
				<span style="background: #ccccce;display: block;padding: 5px 8px;float: left">{$smarty.foreach.it.iteration}</span>
				{if $h.h_finished<2}
				<p style="float: left;margin: 0 40px">操作：<select class="querySelect" name="haul[{$h.h_tid}][item][{$i.hc_tid}][h_collect_type]" >{html_options options=$ctype selected=$i.h_collect_type}</select></p>
				<p style="float: left;margin: 0 40px">说明：<input
							class="infoTableInput" type="text"
							name="haul[{$h.h_tid}][item][{$i.hc_tid}][h_collect_des]" value="{$i.h_collect_des}" style="float: none"/></p>
				{else}
				<p style="float: left;margin: 0 40px">
					<input type="hidden" name="haul[{$h.h_tid}][item][{$i.hc_tid}][h_collect_type]" value="{$i.h_collect_type}">
				{if $i.h_collect_type==0}扫描{/if}
				{if $i.h_collect_type==1}输入{/if}
				{if $i.h_collect_type==2}数字输入{/if}
				{if $i.h_collect_type==3}拍照{/if}
				{if $i.h_collect_type==4}录音{/if}
				</p>
				<p style="float: left;margin: 0 40px">{$i.h_collect_des}</p>
				{if $i.h_collect_type<3}
				<p style="float: left;margin: 0 40px">{$i.h_collect_val}</p>
				{/if}
				{if $i.h_collect_type==3&&$i.ar!=null}
				{foreach from=$i.ar item=a}
				<a href="{$site_url}/{$a}" target="_blank"><img src="{$site_url}/{$a}" style="height:100px;width:100px"/></a>
				{/foreach}
				{/if}

				{if $i.h_collect_type==4&&$i.ar!=null}
				{foreach from=$i.ar item=a}
				<audio controls="controls">

				<source src="{$site_url}/{$a}" type="audio/ogg">

				你的浏览器太老了，请更新否则没法听语音
				</audio>
				{/foreach}
				{/if}
				{/if}
				<div style="clear: both"></div>
				</div>
				{/foreach}
				<div style="clear: both"></div>
				</div>
				</div>
				{/foreach}
			</div>
			{if $canedit&&$haullist}
				<table class="infoTable" style="padding: 0">
					<tr>
						<th style="padding: 5px"><input class="formbtn" type="Submit" name="Submit" value="{$lang.submit}" style="width:150px;margin-left: 20px"/></th>
						<td class="ptb20" colspan="7" style="text-align: left"></td>
					</tr>
				</table>
			{/if}
		</form>
	{/if}
{else}
<input type="hidden" value="0" id="wm_tid">
<!-- 	{/if} -->
<style>
.left{float: left;padding: 20px}
.mapdiv{height: 300px;width: 300px}
.fontdiv{height: 30px;line-height: 30px}
</style>

<!-- {if $waybill.wm_tid}} -->
	    
<div class="jui-cut-label fn-mt25" style="margin-top: 20px">
	        <div class="jui-message-bar">异常信息</div>
	    </div>
{foreach from=$exception item=e}
 <div style="border-left: 4px solid #76b5ea;border-top: 1px solid #d3dae0;border-bottom: 1px solid #d3dae0;border-right: 1px solid #d3dae0;margin: 10px 10px 20px 20px;">
	    <form method="post" enctype="multipart/form-data" id="exception_form" action="index.php?app=waybill&act=exceptiondone">
	    <input type="hidden" value="{$e.e_tid}" name="exp[{$e.e_tid}][e_tid]">
	    <input type="hidden" value="{$e.e_w_tid}" name="wm_tid">
	    <div class="left">
	    <div class="fontdiv">类型：{if $e.e_type}{$e.e_type} /{/if} {$e.e_content}</div>
	    <div class="fontdiv">时间：{$e.e_op_date|date:Y-m-d H:i}</div>
	    <div class="fontdiv">位置：{$e.e_address}</div>
	    <div id="allmap_{$e.e_tid}" class="mapdiv"></div>
	<script>
	var map = new BMap.Map("allmap_{$e.e_tid}");
    map.centerAndZoom(new BMap.Point({$e.e_lng}, {$e.e_lat}), 15);
    map.enableScrollWheelZoom();

    var point = new BMap.Point({$e.e_lng}, {$e.e_lat});    
    var marker = new BMap.Marker(point);        // 创建标注    
    map.addOverlay(marker);
	</script>
	<div style="clear: both"></div>
	    </div>
	    <div class="left">
	    {if $e.e_text_note}
	     <div class="fontdiv">文字：{$e.e_text_note}</div>
	     {/if}
	 {if $e.e_pic}
	    <div class="">图片：
	    
	    {foreach from=$e.e_pic item=p}
	    <a href="{$site_url}/{$p.ea_content}" target="_blank" style=""><img src="{$site_url}/{$p.ea_content}" style="height:100px;width:100px;vertical-align: top;"/></a>
		{/foreach}	   
	    <div style="clear: both"></div>
	    </div>
	    {/if}
	       {if $e.e_voice}
	    {foreach from=$e.e_voice item=v}
	    <div class="fontdiv" style="line-height: 50px;height: 50px;margin-top: 20px">录音：
	    <audio controls="controls" style="vertical-align: top">

<source src="{$site_url}/{$v.ea_content}" type="audio/ogg">

你的浏览器太老了，请更新否则没法听语音
</audio>
	    {/foreach}	   
	    </div>
	    {/if}
	    <div class="fontdiv" style="float: left;width: 168px">状态：{$e.e_staus}</div>
	    <div class="fontdiv" style="float: left;width: 300px">处理人：<input type="text" name="exp[{$e.e_tid}][e_handle_person]" value="{$e.e_handle_person}" style="height: 23px;
   
    padding: 0px 5px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;"/></div>
	    <div style="clear: both"></div>
	     <div class="fontdiv" style="position: relative;">时间：<input type="text" id="e_handle_date_{$e.e_tid}" name="exp[{$e.e_tid}][e_handle_date]" value="{if $e.e_handle_date}{$e.e_handle_date|date:Y-m-d H:i}{else}-{/if}" style="height: 23px;
   
    padding: 0px 5px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;width: 350px"/><a href="javascript:void(0);" onclick="timeimg('4','1',{$e.e_tid});"  class="right_a" style="right: 70px;
    top: 2px;"><img src="templates/images/newadmin/rili.png" alt=""></a></div>
    <script>
					$('#e_handle_date_{$e.e_tid}').datetimepicker({changeMonth: true,changeYear: true});
	</script>
	      <div class="fontdiv">备注：<textarea style=" width: 350px;height: 120px;
   
    padding: 0px 5px;
    border: 1px solid #ccc;
    outline: 0;
    font-size: 14px;
    line-height: 19px;" name="exp[{$e.e_tid}][e_handle_note]">{$e.e_handle_note}</textarea></div>
	    </div>
	    	<div style="clear: both"></div>
	    	{if $e.e_staus!='已处理'}
		<table class="infoTable" style="padding: 0">
			<tr>
				<th style="padding: 5px"><input class="formbtn" type="Submit"
					name="Submit" value="{$lang.submit}" style="width:150px;margin-left: 20px"/></th>
			<td class="ptb20" colspan="7" style="text-align: left"></td>

			</tr></table>
			{/if}
	</form>
	</div>
{/foreach}
	
<!-- 	{/if} -->
</div>
	
{include file="footer.html"}